
#ifndef FFMPEGOPENCV_HAOFFMPEG_H
#define FFMPEGOPENCV_HAOFFMPEG_H

#include <pthread.h>
#include "macro.h"
#include "JavaCallback.h"
#include "AudioChannel.h"
#include "VideoChannel.h"


extern "C" {
#include <libavformat/avformat.h>
};


class HaoFFmpeg {
public:
    HaoFFmpeg(const char *dataSource, JavaCallback *javaCallback);

    ~HaoFFmpeg();

    void prepare();

    void prepare_open();

private:
    JavaCallback *javaCallback;
    char *dataSource;
    pthread_t pid;
    //AVFormatContext包含视屏 宽高等信息
    AVFormatContext *avFormatContext;
    AudioChannel *audioChannel;
    VideoChannel *videoChannel;
};


#endif //FFMPEGOPENCV_HAOFFMPEG_H
